<include file="Member:leftmenu" />
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/tree.css" />
<style>
    .container,
    .navbar-static-top .container,
    .navbar-fixed-top .container,
    .navbar-fixed-bottom .container {
        width: auto;
    }

    a {
        color: #000
    }

    a,
    a:link,
    a:hover {
        text-decoration: none
    }
</style>
<div id="app" class="content-right fl">
    <div class="tree well">
        <ul>
            <li class="parent_li"><span title="Collapse this branch"><i class="icon-minus-sign"></i>胡灵敏-13141922-省级代理</span><a
                    style="color:blue;" href="/admin/member/index?user_id=13141922" target="_blank">查看该用户</a><ul>
                    <li><span><i class="icon-leaf"></i>房琳琳-13141947-加盟店</span><a style="color:blue;" href="/admin/member/index?user_id=13141947"
                            target="_blank">查看该用户</a></li>
                    <li class="parent_li"><span title="Expand this branch"><i class="icon-plus-sign"></i>蔡晓玥-13141948-加盟店</span><a
                            style="color:blue;" href="/admin/member/index?user_id=13141948" target="_blank">查看该用户</a><ul>
                            <li style="display: none;"><span><i class="icon-leaf"></i>郭建珍-13142111-加盟店</span><a style="color:blue;"
                                    href="/admin/member/index?user_id=13142111" target="_blank">查看该用户</a></li>
                            <li style="display: none;"><span><i class="icon-leaf"></i>张传英-13142059-加盟店</span><a style="color:blue;"
                                    href="/admin/member/index?user_id=13142059" target="_blank">查看该用户</a></li>
                            <li style="display: none;"><span><i class="icon-leaf"></i>徐艳艳-13142061-加盟店</span><a style="color:blue;"
                                    href="/admin/member/index?user_id=13142061" target="_blank">查看该用户</a></li>
                            <li style="display: none;"><span><i class="icon-leaf"></i>徐欢欢-13142063-加盟店</span><a style="color:blue;"
                                    href="/admin/member/index?user_id=13142063" target="_blank">查看该用户</a></li>
                            <li style="display: none;"><span><i class="icon-leaf"></i>王杰敏-13142069-加盟店</span><a style="color:blue;"
                                    href="/admin/member/index?user_id=13142069" target="_blank">查看该用户</a></li>
                            <li style="display: none;"><span><i class="icon-leaf"></i>冯心怡-13142143-加盟店</span><a style="color:blue;"
                                    href="/admin/member/index?user_id=13142143" target="_blank">查看该用户</a></li>
                        </ul>
                    </li>
                    <li><span><i class="icon-leaf"></i>陈小秋-13142065-加盟店</span><a style="color:blue;" href="/admin/member/index?user_id=13142065"
                            target="_blank">查看该用户</a></li>
                    <li class="parent_li"><span title="Expand this branch"><i class="icon-plus-sign"></i>何美仙-13142056-加盟店</span><a
                            style="color:blue;" href="/admin/member/index?user_id=13142056" target="_blank">查看该用户</a><ul>
                            <li class="parent_li" style="display: none;"><span title="Collapse this branch"><i class="icon-minus-sign"></i>陈珍美-13142124-加盟店</span><a
                                    style="color:blue;" href="/admin/member/index?user_id=13142124" target="_blank">查看该用户</a><ul>
                                    <li><span><i class="icon-leaf"></i>应宗莹-13142125-加盟店</span><a style="color:blue;" href="/admin/member/index?user_id=13142125"
                                            target="_blank">查看该用户</a></li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    <li class="parent_li"><span title="Expand this branch"><i class="icon-plus-sign"></i>夏曼-13142062-区级代理</span><a
                            style="color:blue;" href="/admin/member/index?user_id=13142062" target="_blank">查看该用户</a><ul>
                            <li class="parent_li" style="display: none;"><span title="Collapse this branch"><i class="icon-minus-sign"></i>朱永宝-13142064-加盟店</span><a
                                    style="color:blue;" href="/admin/member/index?user_id=13142064" target="_blank">查看该用户</a><ul>
                                    <li><span><i class="icon-leaf"></i>姚丽-13142148-加盟店</span><a style="color:blue;" href="/admin/member/index?user_id=13142148"
                                            target="_blank">查看该用户</a></li>
                                    <li><span><i class="icon-leaf"></i>李伟玲-13142150-加盟店</span><a style="color:blue;" href="/admin/member/index?user_id=13142150"
                                            target="_blank">查看该用户</a></li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    <li><span><i class="icon-leaf"></i>张燕-13142198-加盟店</span><a style="color:blue;" href="/admin/member/index?user_id=13142198"
                            target="_blank">查看该用户</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>
<script src="/Static/mobile/vant/vue.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
        $('.tree li.parent_li > span').on('click', function (e) {
            var children = $(this).parent('li.parent_li').find(' > ul > li');
            if (children.is(":visible")) {
                children.hide('fast');
                $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
            } else {
                children.show('fast');
                $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
            }
            e.stopPropagation();
        });
    });
    var app = new Vue({
        el: '#app',
        data:{
            provinceList: []
        },
        created: function () {
            this.getProvinceList();
        },
        methods: {
            getProvinceList: function () {
                var self = this;
                $.get('/admin/member/getProvinceList').then(function(res){
                    for(var i=0;i<res.data.length;i++) {
                        self.provinceList.push(res.data[i]);
                    }
                    self.changeProvince(0);
                })
            },
            changeProvince: function (index) {
                var self = this;
                var area_id = this.provinceList[index].area_id;
                $.get('/admin/member/getProvinceChildren?area_id='+area_id).then(function(res){
                    self.provinceList[index].children = [];
                    for(var i=0;i<res.data.length;i++) {
                        self.provinceList[index].children.push(res.data[i]);
                    }
                })
            },
        }
    })
</script>